home *** CD-ROM | disk | FTP | other *** search
/ Hacker's Secrets 4 / Hacker's Secrets 4.iso / privacy / sun413.txt < prev    next >
Internet Message Format  |  1996-03-16  |  32KB

  1. From tmk@uhunix.uhcc.Hawaii.Edu Thu Jun 30 08:54:17 EDT 1994
  2. Subject: How to improve security on a newly installed SunOS 4.1.3 system. 
  3. Summary: How to improve security on a newly installed SunOS 4.1.3 system.
  4. X-Newsreader: TIN [version 1.2 PL2]
  5. Date: Thu, 30 Jun 1994 09:39:10 GMT
  6.  
  7. My appologies for taking so long with this it became much larger than
  8. I'd though it would.   
  9. Please Note:
  10.    1) My intent in this was to limit my audience enough so that 
  11.       this document would not become too large and cumbersome.  
  12.       Please note the intended audience.   
  13.    2) This document is sure to undergo revision, and I hesitate to 
  14.       ever call any revision a final draft.
  15.    3) Please forgive any typo's and gramatical errors.  It's late 
  16.       and I wanted to get this out on a day other than Friday.  
  17.       Send me notes of typos and spelling directly don't bother
  18.       the rest of the net with such.
  19.    4) I'll try to post when I'm able to put this list up on our 
  20.       ftp server ftp.Hawaii.Edu:/pub/security.
  21.    
  22. Again many thanks to all those who provided feedback.
  23.  
  24. I'm not sure where the other lists are but here's what I've got,
  25. please let me know if it's of help:
  26.  
  27. ----------------------------------------------------------------------
  28.  
  29.  
  30. How to improve security on a newly installed SunOS 4.1.3 system. 
  31.  
  32.        Version 1.0..Thomas M. Kroeger   - July 94
  33. ....tmk@hawaii.edu
  34.  
  35. Copyright -- Thomas M. Kroeger   - July 94
  36.    Please feel free to redistribute or include this list or parts of it
  37. wherever you desire, but, please include appropriate citation.
  38.  
  39. Goal -   
  40.    Attempt to provide a list of some of the more basic steps that 
  41. can be done to improve security on a newly installed SunOS 4.1.3 system.
  42. This is by no means an all inclusive list of actions, just a list of 
  43. some simple and more common measures.  
  44.  
  45. Intended Audience -
  46.    Anyone responsible for the system administration duties of a machine
  47. running SunOS 4.1.3.  These recommendations applicable to a stand-alone  *
  48. workstation. It is assumed that the reader has some familiarity with basic 
  49. system administration (you should be able to do a basic system installation 
  50. by yourself, install patches, and use an editor).
  51.  
  52. [* which may be connected to a larger network?]
  53.  
  54.   NOTE: This list limits it's coverage to measures that can
  55. be done for a stand-alone workstation addition to the steps listed here 
  56. there are many measures that can be taken to improve the security of 
  57. an enviornment, measures such as; filtering traffic to  port 2049/udp 
  58. at the routers will prevent NFS calls from outside your domain.
  59.  
  60.  
  61. Disclaimer ---
  62. These recommendations come with no guarantees of anything!  Support is only
  63. offered within the University of Hawai'i community.
  64.  
  65. The truly paranoid may wish to these implement these recommendations while in 
  66. single user mode as an extra measure of security to avoid possible subversive
  67. shenannigans by a wily cracker.
  68.  
  69. .
  70. To Do on a system Just installed
  71. ------------------------------
  72.  
  73. Patches --
  74. + install the following patches
  75.  
  76. 4.1.3 Security listing
  77.    100103    SunOS 4.1;4.1.1;4.1.2;4.1.3: script to change file permissions
  78.    100173    SunOS 4.1.1/4.1.2/4.1.3 : NFS Jumbo Patch
  79. *  100224    SunOS 4.1.1,4.1.2,4.1.3: /bin/mail jumbo patch
  80.    100257    SunOS 4.1.1;4.1.2;4.1.3: jumbo patch for ld.so, ldd, and ldconf
  81.    100272    SunOS 4.1.3: Security update for in.comsat.
  82.    100296    SunOS 4.1.1, 4.1.2, 4.1.3: netgroup exports to world
  83.    100305    SunOS 4.1.1, 4.1.2, 4.1.3: lpr Jumbo Patch
  84.    100372    SunOS 4.1.1;4.1.2;4.1.3: tfs and c2 do not work together
  85. *  100377    SunOS 4.1.1, 4.1.2, 4.1.3: sendmail jumbo patch
  86. *  100383    SunOS 4.0.3;4.1;4.1.1;4.1.2;4.1.3: rdist security and hard link
  87.    100448    OpenWindows 3.0: loadmodule is a security hole.
  88.    100452    OpenWindows 3.0: XView 3.0 Jumbo Patch
  89.    100478    OpenWindows 3.0: xlock crashes leaving system open
  90. *  100482    SunOS 4.1;4.1.1;4.1.2;4.1.3: ypserv and ypxfrd fix, plus DNS fi
  91.    100507    SunOS 4.1.1, 4.1.2, 4.1.3: tmpfs jumbo patch
  92.    100513    SunOS 4.1.1;4.1.2;4.1.3: Jumbo tty patch
  93.    100564    SunOS 4.1.2, 4.1.3: C2 Jumbo patch
  94. *  100593    SunOS 4.1.3: Security update for dump.
  95.    100623    SunOS 4.1.2;4.1.3: UFS jumbo patch
  96.    100630    SunOS 4.1.1, 4.1.2, 4.1.3: SECURITY: methods to exploit login/su
  97.    100631    SunOS  4.1.x: env variables can be used to exploit login(US only)
  98. *  100632    SunSHIELD 1.0: ARM jumbo patch release
  99.    100890    SunOS 4.1.3: domestic libc jumbo patch
  100.    100891    SunOS 4.1.3: international libc jumbo patch
  101.    100909    SunOS 4.1.1;4.1.2;4.1.3: Security update for syslogd.
  102.    101072    SunOS 4.1.1;4.1.2;4.1.3: Non-related data filled the last block
  103.    101080    SunOS 4.1.1 4.1.2 4.1.3: security problem with expreserve
  104.    101200    SunOS 4.1.1, 4.1.2, 4.1.3: Breach of security using modload
  105.    101206    ODS 1.0; NFS/fsirand security fix.
  106. *  101480    SunOS 4.1.1;4.1.2;4.1.3: Security update for in.talkd.
  107. *  101482    SunOS 4.1.3, 4.1.2, 4.1.1: Security update for write.
  108.    101640    SunOS 4.1.3: in.ftpd logs password info when -d option is used.
  109.    101710    ONLINE DISKSUITE (ODS) 1.0: Security update for dump.
  110.  
  111. 4.1.3 U1 security listing
  112.    101434    SunOS 4.1.3_U1: lpr Jumbo Patch
  113. *  101435    SunOS 4.1.3_U1: ypserv fix
  114. *  101436    SunOS 4.1.3_U1: bin/mail jumbo patch
  115.    101440    SunOS 4.1.3_U1: security problem: methods to exploit login/su
  116.    101558    SunOS 4.1.3_U1: international libc jumbo patch
  117. *  101579    SunOS 4.1.3_U1: Security problem with expreserve for Solaris 1.
  118.    101587    SunOS 4.1.3_U1: security patch for mfree and icmp redirect
  119.    101590    ONLINE DISKSUITE (ODS) 1.0, NFS/fsirand security fix
  120.    101621    SunOS 4.1.3_U1: Jumbo tty patch
  121. *  101665    SunOS 4.1.3_U1: sendmail jumbo patch
  122.    101679    SunOS 4.1.3_U1: Breach of security using modload
  123.    101759    SunOS 4.1.3_U1: domestic libc jumbo patch
  124.  
  125.    * - Note: some patches may not be required if you are disabling this
  126.    feature.  If this is the case, ensure that all relevant files have had 
  127.    their mode changed to remove the SUID bit  -- chmod u-s <file>.
  128.  
  129.    Note 2: Some patches may not necessarily apply based on packages 
  130.    installed (US Encryption...) or your configuration.  Please carefully 
  131.    check the README for each patch.
  132.    Patches are available via anonymous ftp from 
  133.                                      ftp.uu.net:/system/sun/sun-dist
  134. .
  135. Network level changes -------
  136.  
  137. + Disable source routing
  138.   Why:
  139.    Source routing enables the originating host to dictate the route the 
  140.    packet will take.   This can be used to spoof a system into believing
  141.    that the packets are coming from a trusted source.
  142.   How: 
  143.    Install patch found in Ref. 19
  144.   More info: Ref. 2 [Cheswick 94] Chap 2, Ref. 19
  145.  
  146. + Comment out all unnecessary services in /etc/inetd.conf
  147.   Why:
  148.    RPC services can be used to gain access as well as information about
  149.    a system.  These are very site specific adjustments and will have to
  150.    be tailored to your needs.  Additionally, TCP wrappers [Ref. 4] can be 
  151.    used to improve loging, prevent IP spoofing (one host pretending to be 
  152.    another to gain access) and limit access to a service as well as 
  153.    totally removing it.
  154.   How:
  155.    Edit file /etc/inetd.conf and put a # in front of services that
  156.    are not needed.
  157.  
  158.      Services possibly needed, but probably desired:
  159. .ftp - possible needed for file transfer, however if all you 
  160. .      want is outgoing ftp then this is can be commented out.
  161. .telnet - obvious (recommend restricting with TCP wrappers Ref. 4)
  162. .finger - Possibly but better to get a modified version that doesn't
  163. .. give up that much information (To be honest I have no
  164.                  experience with any of these I'd recommend checking into
  165.                  some of the ones on ftp.uu.net).
  166. .talk - nice to have but how much will you miss it?
  167.  
  168.      Services which are probably unnecessary - see man pages for details
  169. .name - for name services (man tnamed)
  170. .comsat - for mail - not necessary.
  171. .login - for rlogin - please see discussion under ruserok().
  172. .uucp - if you aren't sure if your using this then you are not.
  173. .exec - services for rexecd  - do without.
  174.  
  175.       Services recommended against - FIND A WAY TO LIVE WITHOUT.
  176. .shell - for rsh -- major source for security problems
  177. .tftp -  only needed for support of an X terminal or diskless
  178.                 clients, doubtfully needed on a desktop machine.
  179.   More info: Ref. 4 [Venema 92]., Ref. 15
  180.  
  181.  
  182. + Enable NFS port monitoring (This is of value only if you are exporting 
  183.     filesystems over NFS)
  184.   Why:
  185.    Port monitoring ensures that calls to NFS to mount a file system come
  186.    from a port < 1024  (in other words, a port that requires root 
  187.    access to use).
  188.   How:
  189.    The default /etc/rc.local sets up port monitoring only if the file
  190.    /etc/security/passwd.adjunct exists.  If you will be implementing 
  191.    shadowing then you can skip over this step.  If you will not be
  192.    implementing shadowing and you will be exporting files then you should 
  193.    modify /etc/rc.local to do the following 2 lines: (regardless of 
  194.    whether the passwd.adjunct file exists):
  195.        echo "nfs_portmon/W1" | adb -w /vmunix /dev/kmem > /dev/null 2>&1
  196.        rpc.mountd
  197.  
  198.    Shadowing is covered under the section Changes to ID Management.
  199.  
  200.    Note: one possible side effect: non-sun nfs client might not 
  201.           be able to mount exported files.
  202.   More info: Ref. 3 [Stern 92] pg 177 & mountd(8C)
  203.  
  204. + Ensure that ypbind is started with the -s option.
  205.   Why:
  206.    Users could easily start thier own ypbind services and activate a 
  207.    phony NIS database giving them access as any user.
  208.   How:
  209.    As with port monitoring the default /etc/rc.local sets up ypbind in the
  210.    secure mode (-s option) only if the file /etc/security/passwd.adjunct 
  211.    exists.  If you will be implementing shadowing then you can skip over
  212.    this step, overwise you should modify /etc/rc.local to start ypbind 
  213.    with the -s option regardless of whether the passwd.adjunct file exists.
  214.   More info: ypbind(8)
  215.  
  216. + Disable IP forwarding -  
  217.   Why:
  218.    I'm not sure if this can be abused on a machine with only one interface
  219.    but I'd rather err of the side of safety.  It could be used to spoof
  220.    an IP address.
  221.   How:
  222.    Install the following line in the kernel configuration file:
  223.        options "IPFORWARDING=-1"
  224.    For info on how to custom configure a kernel, see the file
  225.    /usr/sys/`arch`/conf/README.
  226.  
  227. .
  228. Kernel changes  -------
  229.  
  230. + modify ruserok() in /usr/lib/libc.so.1.8 (9 on 4.1.3 U1) to disable:  
  231.             -  root .rhosts authentication, wildcards in .rhosts, or
  232.               .rhosts entirely depending on the level of security you want.
  233.   Why: 
  234.    ruserok() is a library routine that does the checking of both the 
  235.    .rhosts and /etc/hosts.equiv files for all the r commands. 
  236.     a) ruserok() uses the source IP address in the rpc request for 
  237.    authentication.  There are no guarantees that this address is correct.
  238.    This address can easily be spoofed, yielding illegitimate access to 
  239.    a system.  
  240.     b) Crackers will often insert +'s into users' .rhosts file
  241.    to allow them to gain access at a latter date.  Most users 
  242.    don't look at their .rhosts file too often.
  243.    Note: While using .rhosts prevents crackers from sniffing your users' 
  244.    passwords, it also make them vulnerable to IP spoofing (claiming
  245.    to be a host that you're not) it becomes a matter of preference
  246.    what level of protection you'd choose here.  
  247.      
  248.   How:  
  249.    To modify the source code requires a source code license.
  250.    At Univ of Hawaii,  modified version of libc.so.1.8 should be 
  251.    available though the systems group.
  252.  
  253.    For those who wish to create thier own modified version of ruserok()
  254.    please see the section at the end that describes some of the details
  255.    for creating a custom libc.so.   
  256.  
  257.    Additionally the logdaemon package Ref. 15 has a modified version
  258.    of libc.so that helps with this.  This site also has BSD sources
  259.    for the ruserok() routine.
  260.  
  261.    Finally TCP wrappers can also be used to restrict access to each
  262.    individual r command. Ref. 4
  263.  
  264.   More info: ruserok(3), hosts.equiv(5),
  265.               source code file /lib/libc/net/rcmd.c, Ref. 4, Ref. 15
  266.  
  267.  
  268.  
  269. Filesystem change----------
  270.  
  271. + create the file /etc/ftpusers 
  272.   Why: 
  273.    This file is a list of users that will not be allowed to access the
  274.    system via ftp.  This prevents Joe Cracker from using ftp to
  275.    modify a file (such as /etc/passwd) if he is able to determine your 
  276.    root password.   
  277.   How: 
  278.    create the file /etc/ftpuser with the following entries (one per line):
  279.     root, nobody, daemon, sys, bin, uucp, news, ingres, AUpwdauthd,
  280.     AUyppasswdd, sysdiag, sundiag, and any other ID's that exist that
  281.     you don't want to allow ftp access.
  282.  
  283.   More info: man ftpusers(5)
  284.  
  285. + Remove the + in /etc/hosts.equiv
  286.   Why: 
  287.    Well..... Everyone gains access with this. 
  288.    Note: This file should not have any comment lines. 
  289.   More info: hosts.equiv(5)
  290.  
  291. + edit /etc/exports  remove all entries you don't want exported.
  292.    - ensure whatever entries remain have restricted access
  293.   Why: 
  294.    NFS leaves the normal file system protection up to the client 
  295.    instead of the server.  Acracker with root access on a client can 
  296.    work around many of these protections. As a result filesystems 
  297.    exported to the world are particularly vulnerable.
  298.   How: 
  299.    Edit the file /etc/exports
  300.    1) Only export what you need to export. If you aren't certain that 
  301.       it needs to be exported, then it probably doesn't.
  302.    2) Never export to the world.  Use a -access=host.foo.bar.edu option.
  303.    3) When ever possible export the file systems read-only. option ro
  304.    You can use showmount -e to see what you currently have exported.
  305.  
  306.   More info: exports(5), exportfs(8), showmount(8) 
  307.  
  308. + Install random number inode generator on filesystems fsirand
  309.   Why:
  310.    Predicable root handles assists crackers in abusing NFS.  After 
  311.    installing the patch for fsirand you'll need to run fsirand for
  312.    all your filesystems.
  313.   How:
  314.    Ensure the filesystem is unmounted and run fsirand.     
  315.   More info: fsirand(8), SunOS patch 100173 (NFS Jumbo)
  316.  
  317. + nosuid in mounts
  318.    Why:
  319.     Use the nosuid option when adding entries to /etc/fstab to mount a 
  320.     filesystem exported by another host.  Anyone gaining access to the
  321.     other host can create or modify an existing program which could 
  322.     compromise your system.   Note: this doesn't work on tmpfs filesystems.
  323.    How: 
  324.     Include the nosuid when you add an entry to /etc/fstab to import 
  325.     a filesystem.
  326.    More info: Ref. 3 [Stern 92] pg. 175 fstab(5)
  327.  
  328. + Edit /etc/ttytab to remove the secure option from all entries.
  329.   Why:
  330.    The secure entry in /etc/ttytab allows logins directly to root on that
  331.    tty.   If you feel that your machine is not in a physically secure 
  332.    location, you may choose to remove the secure option from the 
  333.    console as well.
  334.   More info: ttytab(5)
  335.  
  336. + Set eeprom secure field to command or full -
  337.   Why: 
  338.    If you feel that your machine is not in a secure location, then 
  339.    the eeprom field secure can be used to prevent unauthorized root 
  340.    access by crashing your machine.   Note: with the full option the 
  341.    system will not auto-reboot and will wait for the root password to 
  342.    be entered.
  343.   More info: eeprom(8)
  344.  
  345. + chmod 600 /dev/eeprom -
  346.   Why:
  347.    Prevents users from reading the eeprom passwd.
  348.   More info: eeprom(8)
  349.  
  350. + Remove openprom support if you do not intend to use the eeprom 
  351.    secure field.
  352.   Why:
  353.    A cracker who gains root access could install an eeprom password and
  354.    make your life a bit harder.
  355.   How:
  356.    Remove the device driver from the kernel by commenting out
  357.    the following:
  358.   
  359.    # The "open EEPROM" pseudo-device is required to support the
  360.    # eeprom command.
  361.    #
  362.    pseudo-device   openeepr        # onboard configuration NVRAM
  363.   More info: eeprom(8)
  364.  
  365. + Uncomment security options in frame buffer table file /etc/fbtab
  366.   Why:
  367.    Without these entries ownership of console devices will not be properly
  368.    set.
  369.   More info: fbtab(5)
  370.  
  371. + add umask 022 to /etc/rc & /.login
  372.   Why:
  373.    Prevent key files created during startup and root operation from
  374.    being created world writeable.  Note you may want to set umask in 
  375.    /.login to 077 instead of 022
  376.   More info: umask(1), rc(8)
  377.  
  378. + chmod go-w /etc/* ; chmod g+w /etc/dumpdates
  379.   Why:
  380.    None of these file in /etc should require write access 
  381.    by world except for dumpdate, which requires group write access.
  382.   More info: chmod(1), aliases(5), state(5), utmp(5V), remote(5), rmtab(5)
  383.  
  384. + edit /etc/rc.local to comment change part that chmod's 666 motd
  385.   Why: 
  386.    /etc/motd is the normal system's message of the day; it won't
  387.    allow people to gain root access, but it could be a nuisance if they
  388.    can change this anonymously.  Additionally it is important to
  389.    ensure that the line "rm -f /tmp/t1" is at the begining of this part.
  390.  
  391. + Chmod u-s the following files unless you specifically use them:
  392.   Why: 
  393.    Changing the modes for those file which you will not be using 
  394.    helps prevent would be crackers from exploiting unknown security 
  395.    flaws in these files which could be used to compromise your system.
  396.  
  397.     /usr/bin/cu ./usr/bin/tip ../usr/bin/fusage .
  398.     /usr/bin/nsquery ./usr/bin/uucp ../usr/bin/uuname 
  399.     /usr/bin/uustat ./usr/bin/uux ../usr/ucb/rcp 
  400.     /usr/ucb/rdist ./usr/ucb/rlogin ./usr/lib/uucp/uusched
  401.     /usr/lib/uucp/uuxqt /usr/ucb/rsh../usr/lib/uucp/uucico 
  402.     /usr/games/hack     /usr/games/chesstool ./usr/games/fortune 
  403.     /usr/lib/exrecover  /usr/games/robots   ./usr/lib/uucp/remote.unknown
  404.     /usr/games/hack ./usr/games/snake./usr/bin/sunview1/sv_release 
  405.     /usr/etc/rfsetup
  406.     /usr/bin/allocate - used with C2 security.
  407.     /usr/ucb/quota - used with disk quotas
  408.     /usr/lib/expreserve - used to recover edit session that died.
  409.  
  410.     Following may only be needed to be run by user root; as such, they would
  411.     not need to be SUID root:
  412.      /usr/etc/shutdown /usr/lib/acct/accton
  413.  
  414.    More info:  lots of man pages ;-)
  415.  
  416. + chmod g-s the following file unless you specifically use them:
  417.  Why:
  418.    Changing the modes for those file which you will not be using helps 
  419.    prevent would be crackers from exploiting unknown security flaws 
  420.    in these files which could be used to compromise your system.
  421.  
  422.     /usr/bin/wall ./usr/etc/trpt../usr/bin/sunview1/toolplaces 
  423.     /usr/bin/iostat ./usr/bin/ipcs ../usr/ucb/vmstat 
  424.     /usr/ucb/netstat ./usr/etc/arp ../usr/etc/dmesg 
  425.     /usr/etc/dkinfo ./usr/etc/chill ../usr/etc/dumpfs 
  426.     /usr/etc/devinfo ./usr/etc/nfsstat ./usr/old/perfmon 
  427.     /openwin/bin/xload ./usr/kvm/pstat ../usr/kvm/crash 
  428.     /usr/kvm/getcons ./usr/etc/kgmon ../usr/etc/trpt
  429.  
  430.    More info:  lots of man pages ;-)
  431.  
  432. + edit syslog.conf -- uncomment auth & mail lines
  433.   Why: 
  434.    The enables improved loging of logins and su's be prepared for lots of 
  435.    data.
  436.   More info: syslog.conf(5)
  437.  
  438. + chmod 640 /vmunix; chgrp kmem /vmunix ;
  439.   Why: 
  440.    Prevent crackers from finding out more about your kernel configuration.
  441.   
  442. .
  443. Changes to ID management ------
  444.  
  445. + Disable SUID passwd (if using NIS) or -F option in /bin/passwd  
  446.   Why: 
  447.    Here two options exist:
  448.    1) you are using NIS for your user database; so you don't need
  449.    /bin/passwd (and the two hard links to it /bin/chfn & /bin/chsh) 
  450.    to be SUID root.
  451.    2) You will have local entries in your /etc/passwd that you would
  452.    like to be able to change thier own passwd. Then please note that 
  453.    /bin/passwd has a race condition that can be exploited to write to
  454.    files as root, allowing a cracker to gain root access.  
  455.  
  456.    In either case yppasswd (and ypchfn & ypchsh) does not need to 
  457.    be SUID root.
  458.   How:
  459.    In all cases - cd /bin; chmod u-s yppasswd ypchfn ypchsh
  460.    Option 1  - cd /bin; chmod u-s passwd chfn chsh 
  461.    Option 2a - Replace passwd with a proactive (check for bad passwds)
  462.               passwd program.  Ref 7. 
  463.    Option 2b - Do a binary edit of passwd (sun's code) as shown below:
  464.         # cd /bin
  465.         # cp passwd passwd.old; chmod 700 passwd.old
  466.         # adb -w - passwd
  467.         not core file = passwd
  468.         /l 'F:'
  469.         0x68de        This address is required in the following step:
  470.         0x68de/w 0
  471.         0x68de:         0x463a  =       0x0
  472.         <CTRL-D>
  473.        # chmod 4711 /bin/passwd
  474.        Note: The following files should all contain the same code, and
  475.              be SUID root (unless chmod u-s was done above).  If you intend 
  476.              to use any of these, ensure they are a link to the modified 
  477.              file /bin/passwd: yppasswd, ypchfn, ypchsh, chfn, chsh.
  478.   More info: Ref. 6 [8lgm]-Advisory-7.UNIX.passwd.11-May-1994.NEWFIX
  479.  
  480. + remove ID sync:::
  481.   Why: 
  482.    This ID is created to enable the admin to sync the file system before a
  483.    system crash.  It defaults without and password, and can be abused to 
  484.    gain access to the system.  The simplest solution is to live without 
  485.    this feature and remove this ID.
  486.   More info: passwd(5)
  487.  
  488. + Implement shadowing
  489.   Why: 
  490.    To restrict access to all users' encrypted passwords.  Even though 
  491.    passwords are encrypted, Crack (a publicly available program) can 
  492.    be used to effectively guess users' passwords.
  493.   How:
  494.    This can be done two different ways:
  495.     1. by implementing Sun's C2 security package, which 
  496.    provides additional auditing.  I've found that this auditing can be
  497.    troublesome to maintain and I didn't have need for the extensive data.
  498.     2. the second option is to implement shadowing but not C2, this
  499.    procedure is fully explained in detail in Ref. 5.  In short:
  500.        - ensure patch 100564 is installed, (note this also implements 
  501.          securenets for NIS)
  502.        - split /etc/passwd into /etc/passwd & /etc/security/passwd.adjunct
  503.        - split /etc/group into /etc/group & /etc/security/group.adjunct
  504.        - add required Audit users (even if not implementing auditing)
  505.        - comment out the part of rc.local that starts audit
  506.        - reboot.
  507.    The existence of the file /etc/security/passwd.adjunct has several
  508.    other effects in rc.local that improve system security; (ypbind -s 
  509.    and rpc.mountd without -n).
  510.   More info: Ref 5 
  511.  
  512. + ensure all ID's have passwd
  513.   Why: 
  514.     Any ID without a password provides open access to your system,
  515.     Root comes without a password.  
  516.   More info: passwd(5)
  517. .
  518. Modify mail system  -----
  519.   Why: 
  520.    The sendmail program itself has been notorious for numerous bugs that
  521.    gave crackers root access illegitimately.  This is a huge topic and 
  522.    should be a paper or book in itself.  I claim no expertise here, and
  523.    to my great fortune my sendmail experience is limited.  ;-)
  524.       There are several different possible configurations and options 
  525.    I'll outline them and point you to further References. 
  526.  
  527.   Host configuration:
  528.   1. If you intend to send and receive mail directly on your machine.     
  529.      Options are:
  530.    a. Live with sendmail - install the newest version 8.6.9 (currently)
  531. .- ensure a mail file is always in existence for all users
  532.           Ref.10 &11.
  533.         - "chmod u-s /bin/mail" and change sendmail to use "procmail" 
  534. ..or mail.local Ref. 17
  535. .   Ref.where to get???
  536.         - change sendmail default UID in sendmail.cf to 65534   "Ou65534"
  537.         - turn on security features of sendmail:
  538.            "Opauthwarnings needmailhelo noexpn novrfy restrictmailq"
  539.          Refs. 2 [Cheswick & Bellovin 94] & 9 [Costales 93]
  540.  
  541.    b. Install zmailer -- Ref 8 [URL to zmailer package]
  542.         - zmailer does not use /bin/mail so chmod u-s /bin/mail
  543.  
  544.   2. If mail for your host is received on a different host (ie. local mail
  545.      delivery is handled by another host).  Here your system should only
  546.      need to support outgoing mail.  To prevent the sendmail daemon from
  547.      being started comment out the part or /etc/rc.local that starts
  548.      sendmail. For outgoing mail:
  549.    a. install latest version of sendmail. 
  550. . - see config 1 for thing to change in sendmail config.
  551.          - since mail delivery is being handled by main mail host
  552.            there is no need for /bin/mail so - chmod u-s /bin/mail
  553.    b. Install zmailer -- Ref 8 [URL to zmailer package]
  554.         - zmailer does not use /bin/mail so chmod u-s /bin/mail
  555.     
  556.   3. No need for mail whatsoever on this machine
  557.                                      (incoming, outgoing, or internal).
  558.       This is certainly most secure mode because e-mail will not be able to 
  559.       be sent from or to this machine.  This basic restriction of outside
  560.       access will prevent abuse of that access.  
  561.      How:
  562.       To disable mail totally:
  563.       - chmod u-s /usr/lib/sendmail & /usr/lib/sendmail.mx & /bin/mail
  564.       - comment out the part of rc.local that starts sendmail 
  565.  
  566.  
  567. Packages to enable better monitoring and security:
  568. ------------------------
  569.  
  570. + tripwire - Ref.13. 
  571.  - Include all suid & sgid file in config. 
  572.    - I've modified COPS script to check this with every run, awaiting
  573.      response from Dan Farmer if he minds my releasing script.
  574. + tcp wrappers - Ref.4. 
  575. + Cops - Ref. 14  
  576.    - Set up to run each night - be careful to check the 
  577.      bitbucket output to ensure that it is working properly.
  578. + Modified portmapper, login, rshd, rlogind, pidentd from W. Venema 
  579.   Ref. 15
  580. + TAMU tiger scripts - Ref. 16.
  581.  
  582. Note:  the Australian group SERT has put together a package called
  583. MegaPatch that includes several of these packages as well as many 
  584. of the patches to SunOS previously mentioned.  Ref. 18
  585. .
  586. References  
  587. ----------
  588.  
  589. [1] Dan Farmer & Wietse Venema, "Improving the security of your Site by
  590. Breaking Into it",  1993.
  591. URL:ftp.win.tue.nl:/pub/security/admin-guide-to-cracking.Z
  592.  
  593. [2] W. Cheswick & S. Bellovin, "Firewalls and Internet Security," Addison-
  594. Wesley, April  94.
  595.  
  596. [3] H. Stern, "Managing NFS & NIS", O'Reilly & Associates, April 92
  597.  
  598. [4] Wietse Venema, "TCP WRAPPER: Network monitoring, access control and
  599. booby traps," Proceedings of the Third Usenix Unix Security Symposium, 
  600. pg 85-92.  
  601. URL:ftp.win.tue.nl:/pub/security/tcp_wrapper.ps.Z (paper - .txt.Z avail)
  602. URL:ftp.win.tue.nl:/pub/security/tcp_wrappers_6.3.shar.Z (package)
  603.  
  604.  
  605. [5] Eric Oliver, "How to shadow without C2 Auditing", June 94
  606. URL:ftp.Hawaii.Edu:/????????
  607.  
  608. [6]        [8lgm]-Advisory-7.UNIX.passwd.11-May-1994.NEWFIX
  609.  
  610. [7]  Proactive password changing programs 
  611.       (There are several this is the only one who's URL I had available)
  612. URL:info.mcs.anl.gov:/pub/systems/anlpasswd-2.2.tar.Z
  613.  
  614. [8] Zmailer package - 
  615. URL: cs.toronto.edu:/pub/zmailer.tar.Z
  616.                     /pub/zmailer.README
  617.  
  618. [9] Bryan Costales, Eric Allman & Neil Rickert,  "Sendmail,"
  619. O'Reilly & Associates, June 93
  620.  
  621. 8lgm advisories are avaiable though the 8lgm file server -
  622.    8lgm-fileserver@bagpuss.demon.co.uk
  623. [10]        [8lgm]-Advisory-5.UNIX.mail.24-Jan-1992
  624. [11]        [8lgm]-Advisory-5.UNIX.mail.24-Jan-1992.PATCH
  625. [12]        [8lgm]-Advisory-6.UNIX.mail2.2-May-1994
  626.  
  627. [13] Tripwire - Gene Kim & Gene Spafford 1994
  628. URL:ftp.cs.purdue.edu:/pub/spaf/COAST/Tripwire
  629.  
  630. [14] Cops - Dan Farmer & Gene Spafford 1990 
  631. URL:ftp.cert.org:/pub/tools/cops
  632.  
  633. [15] portmapper, login, rshd, rlogind  - Wietse Venema
  634. URL:ftp.win.tue.nl:/pub/security/portmap.shar.Z
  635. URL:ftp.win.tue.nl:/pub/security/logdaemon-XX.tar.Z
  636.  
  637. [16] TAMU tiger script. - Safford et al 93
  638. URL:net.tamu.edu/pub/security/TAMU
  639.  
  640. [17] Local mail delivery agents:
  641. URL:ftp.informatik.rwth-aachen.de:/pub/packages/procmail
  642. URL:ftp ---- ????? mail.local Joerg Czeranski
  643.  
  644. [18] MegaPatch - SERT
  645. URL:ftp.sert.edu.au:/security/sert/tools/MegaPatch.1.7.tar.Z
  646.  
  647. [19] Source Routinng Patch -
  648. URL:ftp.greatcircle.com:/pub/firewalls/digest/v03.n153.Z
  649.  
  650. Acknowledgements:
  651. Thanks to all the people in comp.security.unix who offered their 
  652. suggestions, and thanks to the following people for their kind review:
  653.   casper@fwi.uva.nl (Casper Dik)
  654.   baron@uhunix.uhcc.Hawaii.Edu (Baron  K Fujimoto)
  655.   rgoodman@uhunix.uhcc.Hawaii.Edu (Becky Goodman)
  656.   newsham@uhunix.uhcc.Hawaii.Edu (Tim Newsham)
  657.   andys@unipalm.co.uk (Andy Smith)
  658.  
  659.  
  660. ------  Other Thoughts for future development & other ---
  661.    Didn't have enough time to do these as well as I'd like. 
  662.  
  663. + disable routed (standard routing table)
  664.   Prevents receiving a false routing table.
  665.  
  666. + remove /dev/nit?
  667.  
  668. + Customizing ruserok() - a bit beyond the basics but here's some info:
  669.      If you have source license to 4.1.3 modify the routine 
  670.    ruserok() to return -1  for the cases you wish to disallow.
  671.    To disable .rhosts authentication entirely, simply have this routine
  672.    return -1.  Look at the file /usr/lib/shlib.etc/README for how to modify
  673.    libc.so, note: also make the following changes:
  674.    in the file /usr/lib/shlib.etc/README below the line
  675.      % mv rpc_commondata. rpc_commondata.o
  676.    insert
  677.      % mv xccs.multibyte. xccs.multibyte.o
  678.    in the Makefile:
  679.    change the lines below to read as they do here:
  680.       OBJSORT=/usr/lib/shlib.etc/objsort
  681.       AWKFILE=/usr/lib/shlib.etc/awkfile
  682.    and add the -ldl option at the end of both ld command lines.
  683.  
  684.   More info: ruserok(3), hosts.equiv(5)  
  685.               source code file /lib/libc/net/rcmd.c Ref. 4, Ref. 15
  686.  
  687. --
  688.                                     tmk
  689.  
  690. -----------------------------------------------------------------------
  691. Tom M. Kroeger                                 Pray for wind       
  692. University of Hawaii Computing Center       \    Pray for waves and
  693. 2565 The Mall,  Keller Hall                 |\     Pray it's your day off!
  694. Honolulu HI 96822     (808) 956-2408        |~\   
  695. e-mail: tmk@uhunix.uhcc.hawaii.edu          |__\
  696.                                            ,----+--
  697.  
  698.  
  699.  
  700. From shamel@mais.hydro.qc.ca Thu Jun 30 10:46:57 EDT 1994
  701. Article: 35173 of comp.sys.sun.admin
  702. Newsgroups: comp.sys.sun.admin,comp.sys.sun.apps,comp.sys.sun.wanted
  703. Path: babbage.ece.uc.edu!news.kei.com!uhog.mit.edu!europa.eng.gtefsd.com!howland.reston.ans.net!spool.mu.edu!torn!utnut!utcsri!newsflash.concordia.ca!sifon!clouso.crim.ca!hobbit.ireq.hydro.qc.ca!shamel
  704. From: shamel@mais.hydro.qc.ca (Stephane Hamel)
  705. Subject: Re: System Administration Tools
  706. Message-ID: <Cs7n2I.CI4@ireq.hydro.qc.ca>
  707. Followup-To: comp.sys.sun.admin,comp.sys.sun.apps,comp.sys.sun.wanted
  708. Sender: news@ireq.hydro.qc.ca (Netnews Admin)
  709. Organization: Hydro-Quebec, Montreal, Canada
  710. X-Newsreader: TIN [version 1.2 PL2]
  711. References: <Cs71I5.37C@csfb1.fir.fbc.com>
  712. Date: Thu, 30 Jun 1994 12:37:30 GMT
  713. Lines: 27
  714. Xref: babbage.ece.uc.edu comp.sys.sun.admin:35173 comp.sys.sun.apps:8372 comp.sys.sun.wanted:5799
  715.  
  716. Since this topic often come's around, I'll make my draft copy of an extensive
  717. document I am writting available for ftp (in PostScript format).
  718.  
  719. Be warned that it is still at an early stage, and probably contains lot's of
  720. bad english formulations (my mother language is french...).
  721.  
  722. But still, there is some valuable piece of information. And of course, I am
  723. open to all comments, suggestions and extensions to the information contained
  724. there.
  725.  
  726. The document is entitled "Management and monitoring tools in a distributed
  727. heterogeneous client-server environment" available for ftp on
  728. colt.mais.hydro.qc.ca (131.195.163.41) under /incoming/manmon.ps
  729.  
  730.                  \\\|///
  731.                 \\ ~ ~ //
  732.                 (/ @ @ /)
  733.  +------------oOOo-(_)-oOOo----------+
  734.  |  Stephane Hamel                   |
  735.  |  Technical Advisor/System Admin.  |
  736.  |  Hydro-Quebec/TDSB                |
  737.  |  680 Sherbrooke West, 2nd floor   |
  738.  |  Montreal, Qc (CANADA) H3C 4T8    |
  739.  |  Phone : (514) 289-7916           |
  740.  |  Fax   : (514) 289-7926           |
  741.  |  e-mail: shamel@mais.hydro.qc.ca  |
  742.  +-----------------------------------+
  743.  
  744.  
  745.